<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        class Animal {
            /* constructor => 给属性赋值的 */
            constructor(name, age, gender) {
                this.name = name;
                this.age = age;
                this.gender = gender;
            }
            eat() {
                console.log(this.name + "吃!");
            }
        }

        class Dog extends Animal {
            constructor(name,age,gender) {
                /* super在子类的构造器当中调用父类里面的构造器 */
                super("文渊",18,'男');
                // super(name,age,gender);
            }
        }

        let d = new Dog("阿黄", 18, '妖');
        console.log(d);
    </script>
</body>

</html>